<!DOCTYPE html>
<html lang="en" style="height:100%" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>入库</title>
    <script th:src="@{/js/jquery.min.js}"></script>
    <style>
        #detailMsg1 td {
            text-align: center;
            border-right: 1px solid black;
            width: 90px;
            border:solid #000 1px;
        }
        #detailMsg1 tr,th {
            text-align: center;
            border-bottom: 1px solid black;
            width: 100px;
            font-size: 35px;
        }
        #detailMsg1{
            border-collapse:collapse;
            border:none;

        }

        body{
            background: rgba(88, 200, 148, 0.1);
            background-size: cover;
        }

    </style>
<script>
    $(document).ready(function() {
        search();
        var form = $('detailMsg1')

    });



    function search() {
        setTimeout(search, 3 * 1000);
        $.post("/print/list", {
            inOrOut: "26108"
        }, function (result) {
            // var tr = $('#detailMsg1 tr');
            // for (var i = 1; i <tr.length; i++) {
            //     tr[i].remove();
            // }
            $("td").remove(".ss");      //删除所有class为ss的td标签
            if (result!= null&& result.length!=0) {
                var str = "";
                for (var i = 0; i < result.length; i++) {
                    str = "<tr><td class='ss'>" + result[i].trayCode + "</td>" +
                        "<td class='ss'>" + result[i].productId + "</td>" +
                        "<td class='ss'>" + result[i].barcodeDetail + "</td>" +
                        "<td class='ss'>" + result[i].num + "</td></tr>";
                    $("#detailMsg1").append(str);
                }
            }
        }, "json");

    }


    function existProduct(id)
    {
        var rows = $("table").find("tr").length;
        for (var i = 0; i < rows-1; i++) {
            var selectRow = document.getElementById("detailMsg1").rows[i+1];
            console.log("4444",selectRow)
            if (selectRow.cells[7].innerHTML == id)
                return true;
        }
        return  false;
    }



</script>
</head>
<body style="height: 100%;width: 100%; background:blue">
<div id="tt" >
<table id="detailMsg1" name="detailMsg1" style="border: solid black;width: 100%; ">

    <tr style="text-align: center">
        <th>托盘条码</th>
        <th>物料编号</th>
        <th>子件条码</th>
        <th>件数</th>
    </tr>

</table>
</div>
</body>
</html>